<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>AJAX and Java - veerasundar.com</title>
</head>
<body>
    <div>
    <div><textarea id="weatherReport" cols="100" rows="3" >abc</textarea></div>
    <div id="listTag"></div>
    <div><a href="#" id="getWeatherReport">Nghi Nhanh</a></div>
    </div>
	<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
        <script type="text/javascript" src="http://json-sans-eval.googlecode.com/svn/trunk/src/json_sans_eval.js"></script>
	<script type="text/javascript">
	$(document).ready(function() {
		$("#getWeatherReport").click(function(){
			$.post("random", {alfa:123}, function(data) {	
                            var myJsonObj = jsonParse(data);
                           // alert(data);
                            $("#weatherReport").html(myJsonObj.content); 
                            var listTagsID=myJsonObj.tagsID.toString().split(",");
                            //var listTagsID=listTagsID1.split(",");
                            var lTags="";
                            for (var k=0;k< listTagsID.length;k++) {
                            lTags+="<a href='#' rel='"+listTagsID[k]+"'>"+listTagsID[k]+"</a>     ";
                            }
                            
                           // alert(lTags);
                          $("#listTag").html(lTags)
			});
		});
	});
	</script>
</body>
</html>